// 订单模型

const { Schema, model } = require('mongoose')

const ordersSchema = new Schema({
    orderTime: String,
    orderState: Number,//1.待支付 2.已支付 3.已取消
    isWarranty: {
        type: Number,
        default: 0,// 0.默认  1.退保中 2.退保成功 3.退保失败
    },
    isDel: {
        type: Boolean,
        default: false
    },
    insuresID: {
        type: Schema.Types.ObjectId,
        //关联对外
        ref: 'insuresModel'
    },
    //无用属性
    customersId: {
        type: Schema.Types.ObjectId,
        //关联对外
        ref: 'customersModel'
    }
     //无用属性
}, { versionKey: false });

module.exports.ordersModel = model('ordersModel', ordersSchema, 'orders');